﻿using UI.Support;
using UnityEngine;

namespace UI
{
    public abstract class BaseWindow : MonoBehaviour
    {
        [SerializeField] protected ButtonClick CloseButton;

        private void Awake() =>
            OnAwake();

        protected virtual void OnAwake() =>
            CloseButton.Clicked += Close;

        protected virtual void Close() =>
            Destroy(gameObject);
    }
}